package com.lucky.blessing.network;


import com.lucky.blessing.data.Qiniu;
import com.lucky.blessing.data.UserInfo;
import com.lucky.blessing.data.result.CircleItemResult;
import com.lucky.blessing.data.result.SmsCode;
import com.lucky.blessing.data.result.UserDataInfoResult;
import com.lucky.blessing.data.result.UserInfoResult;
import com.lucky.blessing.data.result.UserPayListResult;
import com.lucky.blessing.data.result.UserSumResult;
import com.mathum.baseapp.data.BaseData;

import java.util.List;

import retrofit2.Call;
import retrofit2.http.Body;
import retrofit2.http.Field;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.GET;
import retrofit2.http.Headers;
import retrofit2.http.POST;
import retrofit2.http.Path;
import retrofit2.http.Query;

/**
 * Created by mathum on 2017/1/4.
 */

public interface Api {

    /*获取验证码*/
    @FormUrlEncoded
    @POST("index.php?g=user&m=register&a=doregisterPhoneSendCode")
    Call<SmsCode> fetchSmsCode(@Field("mobile") String mobile);

    /*注册手机号*/
    @FormUrlEncoded
    @POST("index.php?g=user&m=register&a=doregisterjson")
    Call<BaseData> register(@Field("mobile") String mobile, @Field("password") String password, @Field("mobile_verify") String mobile_verify);

    /*注册手机号*/
    @FormUrlEncoded
    @POST("index.php?g=user&m=register&a=doregisterjson")
    Call<BaseData> register1(@Field("mobile") String mobile, @Field("user_login") String username, @Field("password") String password, @Field("user_nicename") String nicename, @Field("mobile_verify") String mobile_verify, @Field("avatar") String avatar);


    /*login*/
    @FormUrlEncoded
    @POST("index.php?g=user&m=login&a=dologinjson")
    Call<UserInfoResult> login(@Field("username") String mobile, @Field("password") String password);

    /*重置密码*/
    @FormUrlEncoded
    @POST("index.php?g=user&m=login&a=do_mobile_forgot_password_json")
    Call<BaseData> updatePwd(@Field("mobile") String mobile, @Field("password") String password, @Field("mobile_verify") String mobile_verify);

    /*获取朋友圈列表*/
    //@FormUrlEncoded
    @POST("index.php?g=portal&m=list&a=index_json&page=1")
    Call<CircleItemResult> fetchFriendCircle();

    /*获取相册列表*/
    //@FormUrlEncoded
    @GET("index.php?g=portal&m=list&a=index_me_json")
    Call<CircleItemResult> fetchAblum(@Query("userid") String userid);

    /*评论朋友圈*/
    @FormUrlEncoded
    @POST("index.php?g=portal&m=article&a=post_comment_json")
    Call<BaseData> updateComment(@Field("uid") String uid, @Field("postid") String postid, @Field("full_name") String full_name, @Field("content") String content);

    /*评论朋友圈*/
    @FormUrlEncoded
    @POST("index.php?g=portal&m=article&a=do_like_json")
    Call<BaseData> updateSupport(@Field("userid") String uid, @Field("postid") String postid);

    /*获取qiniu Token*/
    @GET("index.php?g=portal&m=index&a=get_QiniuAuthJSON")
    Call<Qiniu> fetchQiniuToken();

    /*发布朋友圈*/
    @FormUrlEncoded
    @POST("index.php?g=portal&m=article&a=add_post_json")
    Call<BaseData> updateFriendCircle(@Field("userID") String uid, @Field("post[post_title]") String post, @Field("photos_url[]") String[] photos_url);

    /*二维码付款交易请求*/
    //@FormUrlEncoded
    @FormUrlEncoded
    @POST("index.php?g=user&m=public&a=getcode_to_user")
    Call<UserSumResult> getCodeToUser(@Field("user_sum_add") String user_sum_add, @Field("sum_touserID") String sum_touserID, @Field("sum_foruserID") String sum_foruserID);

    /*二维码付款交易请求*/
    //@FormUrlEncoded
    @FormUrlEncoded
    @POST("index.php?g=user&m=public&a=getcode_to_username")
    Call<UserSumResult> getCodeToUserName(@Field("user_sum_add") String user_sum_add, @Field("sum_touserID") String sum_touserID, @Field("sum_foruserName") String sum_foruserName);


    /*二维码收款交易请求*/
    //@FormUrlEncoded
    @FormUrlEncoded
    @POST("index.php?g=user&m=public&a=getcode_for_user")
    Call<UserSumResult> getCodeForUser(@Field("user_sum_add") String user_sum_add, @Field("sum_touserID") String sum_touserID, @Field("sum_foruserID") String sum_foruserID);

    /*获取用户个人资料请求*/
    //@FormUrlEncoded
    @FormUrlEncoded
    @POST("index.php?g=user&m=public&a=get_sum_user")
    Call<UserSumResult> getSumUser(@Field("userID") String userID);

    /*获取好友个人资料请求*/
    //@FormUrlEncoded
    @FormUrlEncoded
    @POST("index.php?g=user&m=public&a=get_userid_forname")
    Call<UserSumResult> getUserInfo(@Field("username") String username);

    /*获取个人交易记录表*/
    //@FormUrlEncoded
    @FormUrlEncoded
    @POST("index.php?g=user&m=public&a=get_user_paylist")
    Call<UserPayListResult> getUserPayList(@Field("userID") String userID);

    /*修改福路彩运用户昵称*/
    @FormUrlEncoded
    @POST("index.php?g=user&m=index&a=do_avatar_json")
    Call<BaseData> updatenickname(@Field("userid") String userid, @Field("user_nicename") String nicename, @Field("imgurl") String imgurl);

    /*修改福路彩运用户支付密码*/
    @FormUrlEncoded
    @POST("index.php?g=user&m=index&a=reset_user_paypass")
    Call<BaseData> resetuserpaypass(@Field("userid") String userid, @Field("user_paypass") String user_paypass);

    /*获取用户个人资料*/
    @FormUrlEncoded
    @POST("index.php?g=user&m=index&a=get_user_info")
    Call<UserDataInfoResult> getUserDataInfo(@Field("user_id") String user_id);

    /*更新用户个人资料*/
    @FormUrlEncoded
    @POST("index.php?g=user&m=index&a=edit_user_info")
    Call<BaseData> edituserinfo(@Field("user_id") String user_id,@Field("real_name") String real_name,@Field("user_idnumber") String user_idnumber,@Field("user_address") String user_address,@Field("user_friend") String user_friend,@Field("friend_mobile") String friend_mobile,@Field("user_cardphoto") String user_cardphoto);


}
